<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>

<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="formId" th:object="${Form}">
        <input id="id" name="id" class="form-control" th:value="*{id}" type="hidden">
        <input  class="form-control" th:value="*{procInstanId}" type="hidden">
        <input id="id" name="taskId" class="form-control" type="hidden" th:value="${taskId}">
        <div class="form-group">
            <label class="col-sm-3 control-label">申请人：</label>
            <div class="col-sm-8 form-control-static" th:text="*{proposer_Id}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房间名：</label>
            <div class="col-sm-8 form-control-static" th:text="*{roomName}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">申请时间：</label>
            <div class="col-sm-8 form-control-static" th:text="*{#dates.format(createTime,'yyyy-MM-DD HH:mm:ss')}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">开始时间：</label>
            <div class="col-sm-8 form-control-static" th:text="*{#dates.format(useStartTime,'yyyy-MM-DD HH:mm:ss')}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">结束时间：</label>
            <div class="col-sm-8 form-control-static" th:text="*{#dates.format(useEndTime,'yyyy-MM-DD HH:mm:ss')}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">申请理由：</label>
            <div class="col-sm-8">
                <div class="col-sm-8 form-control-static" th:text="*{reason} == ''? '无':*{reason}" >
                </div>
            </div>

        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <div class="col-sm-8 form-control-static" th:text="*{remark}== ''? '无':*{remark}">
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">回复：</label>
            <div class="col-sm-8">
                <textarea type="text" class="form-control" name="reply"></textarea>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <label class="checkbox-inline i-checks">
                    <span th:if="*{status} eq '0' " class="btn btn-warning btn-xs ">预约中</span>
                    <span th:if="*{status} eq '1' " class="btn btn-success btn-xs ">同意</span>
                    <span th:if="*{status} eq '2' " class="btn btn-danger btn-xs ">拒绝</span>
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="col-sm-8">
                <label class="checkbox-inline i-checks">
                    <input type="radio" name="status" value="1" checked/>
                    同意
                </label>
                <label class="checkbox-inline i-checks">
                    <input type="radio" name="status" value="2"/>
                    拒绝
                </label>
            </div>
        </div>
        <div class="form-group" shiro:hasPermission="task:update">
            <div class="form-control-static col-sm-offset-9">
                <button type="submit" class="btn btn-primary">审批</button>
                <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">

    var prefix = "/task";
    $("#formId").validate({
        submitHandler: function(form) {
            $.operate.save(prefix + "/RoomApproval", $('#formId').serialize());
        }
    });

    var time = $("#createTime").val();
    $("#createTime").val($.common.dateFormat(time));
</script>
</body>
</html>
